import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home/myw'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/YouLogin.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/HomeView.vue'),
      children: [
        {
          path: 'coll',
          name: 'coll',
          component: () => import('@/views/home/CollaboraTRion.vue')
        },
        {
          path: 'myw',
          name: 'myw',
          component: () => import('@/views//home/MyWork.vue')
        }
      ]
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/views/center.vue')
    },

    {
      path: '/myb',
      name: 'myb', //一级路由
      component: () => import('@/views/MyWorkbench .vue')
    }
  ]
})

export default router
